home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / term / term_4_3a_Ptch.lha / Update-term4.3 < prev    next >
Text File  |  1995-03-21  |  2KB  |  69 lines

  1. ; $VER: Update-term4.3 1.0 (21.03.95)
  2.  
  3. ;(complete 0)
  4.  
  5. (message (cat "This script will update `term' v4.3 to v4.3a.\nBefore the program "
  6.               "is updated, a backup copy of your old v4.3 release will be made "
  7.               "just in case something goes wrong.\nThis requires that you have "
  8.               "at least 600K bytes free storage space available on your hard "
  9.               "disk drive.\nThe script can tell the plain 68k version and the 030 "
  10.               "version apart, so you do not need to worry about picking the wrong "
  11.               "version."
  12. ))
  13.  
  14. (set original (askfile (prompt "Please locate the `term' v4.3 program")
  15.                        (default "TERM:")
  16.                        (help (cat "Before the installation can proceed "
  17.                                   "you need to indicate where `term' 4.3 "
  18.                                   "was installed."
  19.                        ))
  20. ))
  21.  
  22. (if (<> (exists original (noreq)) 1)
  23. (
  24.     (abort (cat "Could not locate file " original))
  25. ))
  26.  
  27. (set size (getsize original))
  28. (set vers (getversion original))
  29. (set version (/ vers 65536))
  30. (set revision (- vers (* version 65536)))
  31. (set spaceleft (getdiskspace original))
  32.  
  33. (if (< spaceleft 600000)
  34. (
  35.     (abort (cat ("Not enough storage space left, %ld bytes are available, we need at least 600,000 bytes." spaceleft)))
  36. ))
  37.  
  38. (if (= 0 version)
  39. (
  40.     (abort (cat ("Sorry, %s cannot be patched." original)))
  41. ))
  42.  
  43. (if (and (<> size 577252) (<> size 584556))
  44. (
  45.     (abort (cat ("Hm... %s does not look like `term' v4.3." original)))
  46. ))
  47.  
  48. (if (or (<> version 4) (and (= version 4) (<> revision 3)))
  49. (
  50.     (abort (cat ("Who do you think you're fooling, this is v%ld.%ld, not v4.3." version revision)))
  51. ))
  52.  
  53. (rename original "term-4.3-old")
  54.  
  55. (if (= size 577252)
  56.     (set patchfile "term43a030.pch")
  57.     (set patchfile "term43a68k.pch")
  58. )
  59.  
  60. (set @default-dest (pathonly original))
  61.  
  62. (working "Updating `term' to v4.3a")
  63.  
  64. (run ("spatch -o%s -p%s %s" (tackon @default-dest "term") patchfile (tackon @default-dest "term-4.3-old")))
  65.  
  66. (complete 100)
  67.  
  68. (exit ("Your old %s file was renamed to %s." original (tackon @default-dest "term-4.3-old")))
  69.